package book;
//在书的包中定义一个书架
public class BookList {
    //通过数组来组织这么多书.
    //Book[]实际上是一个类
    //定义了一个数组可以放十本书
    private Book[] books=new Book[10];
    //计数器
    private int usedsize;
    //实例化书里面的对象(放书)
    public BookList(){
        //构造方法来初始化成员，也可以用实例化代码块来初始化成员
        this.books[0]=new Book("三国演艺","罗贯中",10,"小说");
        this.books[1]=new Book("西游记","吴承恩",12,"小说");
        this.books[2]=new Book("红楼梦","曹雪芹",13,"小说");
        this.usedsize=3;
    }
    //???????????????????????????????????????????????
    //找书
    public Book getBook(int pos){
        return books[pos];

    }
    //？？？？？？？？？？？？？？？？？？？？？？？？？？？？？？？？？？
    public Book setBooks(int pos,Book book){
        return books[pos]=book;
    }


    public int getUsedsize() {
        return usedsize;
    }

    public void setUsedsize(int usedsize) {
        this.usedsize = usedsize;
    }
}
